﻿using SignalrChat.DbServer;
using SignalrChat.Models;

namespace SignalrChat.Buesses
{
    public class UsersBll
    {
        public List<Users> GetUsers()
        {

            return UsersDao.GetUsers();
        }

        public Users getById(Guid Id)
        {

            return UsersDao.getById(Id);
        }

        public bool AddUsers(Users users)
        {
            if (users==null)
            {
                return false;
            }
            users.Id = Guid.NewGuid();
            users.CreateTime = DateTime.Now;
            return UsersDao.AddUsers(users);
        }

        public bool UpdateUsers(Users users)
        {
            if (users==null) {  return false; }

            return UsersDao.UpdateUsers(users);
        }
        public bool UpdateLoginTime(Guid Id,DateTime dateTime) {

            return UsersDao.UpdateLoginTime(Id, dateTime);
        }
        public bool DeleteUsers(Guid Id)
        {
            return UsersDao.DeleteUsers(Id);
        }
    }
}
